home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Math / trigHype™ / card_8941.txt < prev    next >
Encoding:
Text File  |  1991-03-17  |  4.4 KB  |  217 lines

  1. -- card: 8941 from stack: in
  2. -- bmap block id: 8995
  3. -- flags: 4000
  4. -- background id: 7184
  5. -- name: A,a,b known
  6. ----- HyperTalk script -----
  7. on mouseUp
  8.   set numberFormat to <0.000000>
  9.  
  10.   --Calculate Sin A
  11.   get sin(card field "angle A"*(pi/180))
  12.   put it into mem1
  13.   put it into card field "sin A"
  14.  
  15.   --Calculate Sin B
  16.   get card field "side b"*mem1/card field "side a"
  17.   put it into mem2
  18.   put it into card field "sin B"
  19.  
  20.   --Calculate Angle B
  21.   get atan(mem2/sqrt(-mem2*mem2+1))*(180/pi)
  22.   put it into card field "angle B"
  23.  
  24.   --Calculate Angle C
  25.   get 180-(card field "angle A"+card field "angle B")
  26.   put it into mem3
  27.   put it into card field "angle C"
  28.  
  29.   --Calculate Sin C
  30.   get sin(card field "angle C"*(pi/180))
  31.   put it into card field "sin C"
  32.  
  33.   --Calculate Side C
  34.   get (card field "side b"*card field "sin C")/card field "sin B"
  35.   put it into card field "side c"
  36.  
  37.   --Calculate Area
  38.   get (card field "side a"+card field "side b"+card field "side c")/2
  39.   put it into mem9
  40.   get sqrt(mem9*(mem9-card field "side a")*(mem9-card field "side b") *(mem9-card field "side c"))
  41.   put it into bkgnd field "Area"
  42.  
  43.   --Calculate Perimeter
  44.   get card field "side a"+card field "side b"+card field "side c"
  45.   put it into bkgnd field "Perimeter"
  46. end mouseUp
  47.  
  48.  
  49. -- part 1 (field)
  50. -- low flags: 00
  51. -- high flags: 0002
  52. -- rect: left=305 top=146 right=163 bottom=433
  53. -- title width / last selected line: 0
  54. -- icon id / first selected line: 0 / 0
  55. -- text alignment: 1
  56. -- font id: 3
  57. -- text size: 12
  58. -- style flags: 0
  59. -- line height: 16
  60. -- part name: side a
  61.  
  62.  
  63. -- part 2 (field)
  64. -- low flags: 00
  65. -- high flags: 0002
  66. -- rect: left=112 top=263 right=280 bottom=240
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 1
  70. -- font id: 3
  71. -- text size: 12
  72. -- style flags: 0
  73. -- line height: 16
  74. -- part name: side b
  75.  
  76.  
  77. -- part 3 (field)
  78. -- low flags: 00
  79. -- high flags: 0002
  80. -- rect: left=22 top=217 right=234 bottom=150
  81. -- title width / last selected line: 0
  82. -- icon id / first selected line: 0 / 0
  83. -- text alignment: 1
  84. -- font id: 3
  85. -- text size: 12
  86. -- style flags: 0
  87. -- line height: 16
  88. -- part name: angle A
  89.  
  90.  
  91. -- part 4 (field)
  92. -- low flags: 01
  93. -- high flags: 0004
  94. -- rect: left=245 top=82 right=101 bottom=373
  95. -- title width / last selected line: 0
  96. -- icon id / first selected line: 0 / 0
  97. -- text alignment: 1
  98. -- font id: 3
  99. -- text size: 12
  100. -- style flags: 256
  101. -- line height: 16
  102. -- part name: angle B
  103.  
  104.  
  105. -- part 5 (field)
  106. -- low flags: 01
  107. -- high flags: 0004
  108. -- rect: left=299 top=215 right=234 bottom=427
  109. -- title width / last selected line: 0
  110. -- icon id / first selected line: 0 / 0
  111. -- text alignment: 1
  112. -- font id: 3
  113. -- text size: 12
  114. -- style flags: 256
  115. -- line height: 16
  116. -- part name: angle C
  117.  
  118.  
  119. -- part 6 (field)
  120. -- low flags: 01
  121. -- high flags: 0004
  122. -- rect: left=51 top=135 right=154 bottom=184
  123. -- title width / last selected line: 0
  124. -- icon id / first selected line: 0 / 0
  125. -- text alignment: 1
  126. -- font id: 3
  127. -- text size: 12
  128. -- style flags: 256
  129. -- line height: 16
  130. -- part name: side c
  131.  
  132.  
  133. -- part 7 (field)
  134. -- low flags: 01
  135. -- high flags: 0001
  136. -- rect: left=422 top=50 right=62 bottom=482
  137. -- title width / last selected line: 0
  138. -- icon id / first selected line: 0 / 0
  139. -- text alignment: 0
  140. -- font id: 3
  141. -- text size: 9
  142. -- style flags: 0
  143. -- line height: 12
  144. -- part name: sin A
  145.  
  146.  
  147. -- part 8 (field)
  148. -- low flags: 01
  149. -- high flags: 0001
  150. -- rect: left=422 top=63 right=75 bottom=482
  151. -- title width / last selected line: 0
  152. -- icon id / first selected line: 0 / 0
  153. -- text alignment: 0
  154. -- font id: 3
  155. -- text size: 9
  156. -- style flags: 0
  157. -- line height: 12
  158. -- part name: sin B
  159.  
  160.  
  161. -- part 9 (field)
  162. -- low flags: 01
  163. -- high flags: 0001
  164. -- rect: left=422 top=76 right=88 bottom=482
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 0 / 0
  167. -- text alignment: 0
  168. -- font id: 3
  169. -- text size: 9
  170. -- style flags: 0
  171. -- line height: 12
  172. -- part name: sin C
  173.  
  174.  
  175. -- part contents for card part 1
  176. ----- text -----
  177. 2
  178.  
  179. -- part contents for card part 2
  180. ----- text -----
  181. 3
  182.  
  183. -- part contents for card part 3
  184. ----- text -----
  185. 28.955024
  186.  
  187. -- part contents for card part 7
  188. ----- text -----
  189. 0.484123
  190.  
  191. -- part contents for card part 8
  192. ----- text -----
  193. 0.726184
  194.  
  195. -- part contents for card part 4
  196. ----- text -----
  197. 46.567463
  198.  
  199. -- part contents for card part 5
  200. ----- text -----
  201. 104.477513
  202.  
  203. -- part contents for card part 9
  204. ----- text -----
  205. 0.968246
  206.  
  207. -- part contents for card part 6
  208. ----- text -----
  209. 4.000003
  210.  
  211. -- part contents for background part 3
  212. ----- text -----
  213. 9.000003
  214.  
  215. -- part contents for background part 5
  216. ----- text -----
  217. 2.904736